/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testings;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Random;
import weka.core.Instances;

/**
 *HHAHHAHAH
 * @author Agnitto is annoyed!!!
 * let us see if this works
 */
public class LOF {
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {

        BufferedReader src = new BufferedReader(new FileReader("iris.arff"));
        Instances inst = new Instances(src);
//        BufferedReader src2 = new BufferedReader(new FileReader("random.arff"));
//        Instances inst2 = new Instances(src2);
              
////////////////GRAPHING STUFF//////////////////////////////

        // XY from Instances for scatterplot
        GraphIt gf = new GraphIt();
        gf.changeTitle("From instances, scatterplot");
        gf.addToSeries(inst, 0, 1); //using x and y attributes
        gf.initateGraphing();
////        
////        
//        // just x, histogram from Instances
//        GraphIt gf2 = new GraphIt();
//        gf2.changeTitle("From instances, histogram");
//        gf2.addToSeries(20, inst, 0); // 20 bars, using x attributes
//        gf2.initateGraphing();
//        
//        GraphIt gf3 = new GraphIt();
//        gf3.changeTitle("From instances, histogram");
//        gf3.addToSeries(40,inst2,0); // 20 bars, using x attributes
//        gf3.initateGraphing();
//       
//       
//        
//        // scatterplot, using x/y pairs
        Random generator = new Random();
        double[][] arrays = new double[1000][2];
        for(int i = 0; i < 1000; i++){
            arrays[i][0] = generator.nextGaussian() * 100;
            arrays[i][1] = generator.nextGaussian() * 100; 
        }
        GraphIt gf3 = new GraphIt();
        gf3.changeTitle("From array, scatter");
        gf3.addToSeries(arrays);
        gf3.initateGraphing();
        
        
//        // Histgram, just x
//        double[] arrays2 = new double[1000];
//        for(int i = 0; i < 1000; i++){
//            arrays2[i] = (generator.nextDouble()-0.5) * 600;      
//        }
//        GraphIt gf4 = new GraphIt();
//        gf4.changeTitle("From Array, histogram");
//        gf4.addToSeries(20, arrays2);// 20 bars
//        gf4.initateGraphing();
    }
   
}
